package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusPipeMapper;
import com.ruoyi.business.domain.BusPipe;
import com.ruoyi.business.service.IBusPipeService;
import javax.annotation.Resource;

/**
 * 引入管台账Service业务层处理
 * 
 * @author wf
 * @date 2024-07-18
 */
@Service
public class BusPipeServiceImpl implements IBusPipeService 
{
    @Resource
    private BusPipeMapper busPipeMapper;

    /**
     * 查询引入管台账
     * 
     * @param id 引入管台账主键
     * @return 引入管台账
     */
    @Override
    public BusPipe selectBusPipeById(Long id)
    {
        return busPipeMapper.selectBusPipeById(id);
    }

    /**
     * 查询引入管台账列表
     * 
     * @param busPipe 引入管台账
     * @return 引入管台账
     */
    @Override
    public List<BusPipe> selectBusPipeList(BusPipe busPipe)
    {
        return busPipeMapper.selectBusPipeList(busPipe);
    }

    /**
     * 新增引入管台账
     * 
     * @param busPipe 引入管台账
     * @return 结果
     */
    @Override
    public int insertBusPipe(BusPipe busPipe)
    {
        busPipe.setCreateUser(SecurityUtils.getUserId());
        busPipe.setCreateBy(SecurityUtils.getUsername());
        busPipe.setCreateTime(DateUtils.getNowDate());
        busPipe.setUpdateUser(SecurityUtils.getUserId());
        busPipe.setUpdateBy(SecurityUtils.getUsername());
        busPipe.setUpdateTime(DateUtils.getNowDate());
        return busPipeMapper.insertBusPipe(busPipe);
    }

    /**
     * 修改引入管台账
     * 
     * @param busPipe 引入管台账
     * @return 结果
     */
    @Override
    public int updateBusPipe(BusPipe busPipe)
    {
        busPipe.setUpdateUser(SecurityUtils.getUserId());
        busPipe.setUpdateBy(SecurityUtils.getUsername());
        busPipe.setUpdateTime(DateUtils.getNowDate());
        return busPipeMapper.updateBusPipe(busPipe);
    }

    /**
     * 批量删除引入管台账
     * 
     * @param ids 需要删除的引入管台账主键
     * @return 结果
     */
    @Override
    public int deleteBusPipeByIds(Long[] ids)
    {
        return busPipeMapper.deleteBusPipeByIds(ids);
    }

    /**
     * 删除引入管台账信息
     * 
     * @param id 引入管台账主键
     * @return 结果
     */
    @Override
    public int deleteBusPipeById(Long id)
    {
        return busPipeMapper.deleteBusPipeById(id);
    }

    @Override
    public Integer getIntroductionTubenum() {
        return busPipeMapper.getIntroductionTubenum();
    }
}
